﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SMTC.BO.Plan;
using SMTC.Model.Domain;

/// <summary>
/// Summary description for PlanDataSource
/// </summary>
public class PlanDataSource
{
    private PlanQueryServices _services = new PlanQueryServices();
    public PlanDataSource()
    {
        //
        // TODO: Add constructor logic here
        //
    }

    public List<ImportPlanDomain> Select(string MaterialCode, string BU, string PlanVerion, int haveUnitFlag = 0)
    {

        if (string.IsNullOrEmpty(MaterialCode)) { MaterialCode = "%"; } else { MaterialCode = "%" + MaterialCode.Trim() + "%"; }
        if (string.IsNullOrEmpty(BU)) { BU = "%"; } else { BU = "%" + BU.Trim() + "%"; };
        return _services.GetPlanInfo(MaterialCode, BU, PlanVerion, haveUnitFlag);
    }
}